package com.objetdirect.gwt.umldrawer.shared.dto;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;

@Entity
@Table (name = "PROFILE_PICTURE")
public class ProfilePictureDto implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue
	@Column (name = "picture_id", nullable = false, unique = true)
	private long pictureId ;
	
	@Column (name = "picture_path", nullable = false)
	private String picturePath ;

	@OneToOne (fetch = FetchType.LAZY, targetEntity = DeveloperDto.class)
	@PrimaryKeyJoinColumn (name = "developer_Email")
	private DeveloperDto developerEmail;
	
	public ProfilePictureDto() {
	}
	
	public ProfilePictureDto(long pictureId) {
		this.pictureId = pictureId ;
	}
	
	public ProfilePictureDto(String picturePath, DeveloperDto developerEmail) {
		super();
		this.picturePath = picturePath;
		this.setDeveloperEmail(developerEmail);
	}

	public ProfilePictureDto(long pictureId, String picturePath,
			DeveloperDto developerEmail) {
		super();
		this.pictureId = pictureId;
		this.picturePath = picturePath;
		this.setDeveloperEmail(developerEmail);
	}

	public long getpictureId() {
		return pictureId;
	}
	
	public void setpictureId(long pictureId) {
		this.pictureId = pictureId;
	}

	public String getPicturePath() {
		return picturePath;
	}

	public void setPicturePath(String picturePath) {
		this.picturePath = picturePath;
	}
//
//	public void setdeveloperEmail(DeveloperDTO developerEmail) {
//		this.developerEmail = developerEmail;
//	}
//
//	public DeveloperDTO getdeveloperEmail() {
//		return developerEmail;
//	}

	public void setDeveloperEmail(DeveloperDto developerEmail) {
		this.developerEmail = developerEmail;
	}

	public DeveloperDto getDeveloperEmail() {
		return developerEmail;
	}
}
